package dsq.lesson.cookie.history;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dsq.lesson.cookie.entity.Book;
import dsq.lesson.cookie.util.DBUtil;

@WebServlet("/showBookDetail")
public class ShowBookDetail extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		

		
		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out = response.getWriter();
		

		//显示图书的详细信息
		
		
		//获得id
		String id = request.getParameter("id");
		
		Book book = DBUtil.findBookById(id);
		
		out.print(book);		
		
		//把当前浏览过的书id 写会到客户端
		
		
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
